<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jQuery.min3.6.0.js"></script>
</head>

<body>
    <form id='f1'>
        <!-- id：<input type="text" name="id"> -->
        昵称：<input type="text" name="nickname">
        邮箱：<input type="text" name="email">
        <input type="submit" value="修改用户信息">
    </form>

    <script>
        $(function () {
            $('#f1').submit(function (e) {
                e.preventDefault();
                var data = $(this).serialize();
                console.log(data);
                $.ajax({
                    type: "POST",
                    url: "http://127.0.0.1:5000/my/userinfo",
                    data: data,
                    headers: { 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTEsInVzZXJuYW1lIjoiYWRtaW4iLCJwYXNzd29yZCI6IiIsIm5pY2tuYW1lIjpudWxsLCJlbWFpbCI6bnVsbCwidXNlcl9waWMiOiIiLCJpYXQiOjE2MjMwNzQ2NTgsImV4cCI6MTYyMzExMDY1OH0.I67sO5Xh_b7kUlZWN0Rpqcv72mi2S1HrM5h5QpWOW5w' },
                    success: function (res) {
                        console.log(res)
                    }
                });
            })
        });
    </script>
</body>

</html>